#include "Game_page.h"
#include "IniProgram.h"
#include "MainPage.h"

Container *Menu_Page = nullptr;
Container *Cancle_Btn = nullptr;
Container *ReStart_Btn = nullptr;
Container *Back_Btn = nullptr;
Container *Layout_Btn = nullptr;

extern Container *Main_Page;

void Cancle()
{
    manager.set_top(Game_Page);
}

void Display_Menu_Page()
{
    manager.set_top(Menu_Page);
}



void create_Menu_Page()
{
    Menu_Page = new Container(300, 400);
    Menu_Page->set_Visible();
    Menu_Page->set_background_image("./res/menu_background.bmp", true, 0x000000ff);
    Menu_Page->set_pos(250, 40);
    Menu_Page->set_Event_Type(CLICK);
    manager.add(Menu_Page);

    Cancle_Btn = new Container(Menu_Page, 188, 56);
    Cancle_Btn->set_Visible();
    Cancle_Btn->align(TOP_CENTER, 0, 30);
    Cancle_Btn->set_background_image("./res/Continue_Game.bmp", true, 0x00ffffff);
    Cancle_Btn->set_Event_Type(CLICK);
    Cancle_Btn->set_Event(Cancle);

    ReStart_Btn = new Container(Menu_Page, 177, 57);
    ReStart_Btn->set_Visible();
    ReStart_Btn->align(TOP_CENTER, 0, 110);
    ReStart_Btn->set_background_image("./res/reStart.bmp", true, 0x00ffffff);
    ReStart_Btn->set_Event_Type(CLICK);
    ReStart_Btn->set_Event(Game_Start);

    Layout_Btn = new Container(Menu_Page, 177, 59);
    Layout_Btn->set_Visible();
    Layout_Btn->align(TOP_CENTER, 0, 190);
    Layout_Btn->set_background_image("./res/Layout.bmp", true, 0x00ffffff);
    Layout_Btn->set_Event_Type(CLICK);
    Layout_Btn->set_Event(Display_Layout_Page);

    Back_Btn = new Container(Menu_Page, 171, 60);
    Back_Btn->set_Visible();
    Back_Btn->align(TOP_CENTER, 0, 270);
    Back_Btn->set_background_image("./res/back_main_page.bmp", true, 0x00ffffff);
    Back_Btn->set_Event_Type(CLICK);
    Back_Btn->set_Event(Display_Main_Page);
}